package com.mz.mattress.admin.api.merchant;

import com.mz.mattress.admin.service.AdvertService;
import com.mz.mattress.api.common.Constants;
import com.mz.mattress.api.common.Result;
import com.mz.mattress.api.entity.Advert;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping(Constants.MERCHANT_PATH + "advert")
public class AdvertController {

    @Autowired
    private AdvertService advertService;

    @GetMapping("/list")
    public Result<List<Advert>> list(@RequestParam(required = false) Integer type) {
        return advertService.list(type);
    }

}
